package com.woniuxy.educationplatform.mapper;

import com.woniuxy.educationplatform.bean.SchoolBean;
import com.woniuxy.educationplatform.bean.StatusBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SchoolMapper {

    @Results({
            @Result(id = true,property = "id",column = "id",javaType = Integer.class),
            @Result(property = "schoolName",column = "school_name",javaType = String.class)
    })
    @Select(value = "SELECT id, school_name FROM school_info;")
    List<SchoolBean> selectAllSchool();

    @Results({
            @Result(id = true,property = "id",column = "id",javaType = Integer.class),
            @Result(property = "schoolName",column = "school_name",javaType = String.class)
    })
    @Select(value = "SELECT id, school_name FROM school_info WHERE id = #{ID}")
    SchoolBean selectByID(long ID);
}
